/////////////////////////////////////////////////////////////////////
// CacheMsgHandler.h
//
//
// 11/16/2010
//
/////////////////////////////////////////////////////////////////////

#ifndef __CACHEMSGHANDLER_H__
#define __CACHEMSGHANDLER_H__



#include <map>
#include "Service/Service.h"

class DBMessage;
class CacheService;
class CacheMsgHandler
{
	friend CacheService;
public:
	CacheMsgHandler( void );
	~CacheMsgHandler( void );

	void SetService( Service * svc );
	
	virtual bool handleMsg( DBMessage * message ) const;

private:
	void RegisterMessage( int msgID, CacheMsgHandler* message );
private:
	typedef std::map< int, CacheMsgHandler* > MessageMap;
	typedef std::map< int, CacheMsgHandler* >::iterator MessageMapIter;
	typedef std::map< int, CacheMsgHandler* >::const_iterator MessageMapConstIter;

	static MessageMap ms_MessageMap;

protected:
	static Service*	m_wpSvcLgc;
};



#endif // __CACHEMSGHANDLER_H__